#coding=utf-8
import yaml
from pymongo import MongoClient

class MongoDBConnect():

    #读取数据库配置文件
    # fs = open(r"./Caps/MongoBaseConnect.yaml", encoding="utf-8")
    fs = open(r"E:/df_autoTest/pytest/appium_AutoTest/Caps/MongoBaseConnect.yaml", encoding="utf-8")
    datas = yaml.load(fs,Loader=yaml.FullLoader)
    for i in datas:
        host = i["host"]
        port = i["port"]
        db = i["db"]
        user = i["user"]
        password = i["password"]
    conn = MongoClient(host, port)
    database = conn.db